function hfile = aft_ClearObject(hfile)
% AFT::ClearObject  - remove object from global storage
%
% FORMAT:       obj.ClearObject;
%
% No input / output fields.
%
% TYPES: ALL

% Version:  v0.8a
% Build:    9102122
% Date:     Oct-21 2009, 10:20 PM CEST
% Author:   Jochen Weber, SCAN Unit, Columbia University, NYC, NY, USA
% URL/Info: http://wiki.brainvoyager.com/BVQXtools

% argument check
if nargin ~= 1 || ...
    numel(hfile) ~= 1 || ...
   ~isBVQXfile(hfile, true) || ...
    hfile.L == 1
    error( ...
        'BVQXfile:BadArgument', ...
        'Invalid call to ''%s''.', ...
        mfilename ...
    );
end

% remove from arrays
bvqxfile_clear(hfile.L);
